// $ANTLR 3.4 E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g 2012-03-28 19:05:26
package pl.edu.agh.student.janikhankus.grammar;

import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class GrammarParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ARROW", "COLON", "DIGIT", "EPSILON", "LOWERCASE", "NEWLINE", "NONTERMINAL", "NUMBER", "OR", "PROBABILITY", "TERMINAL", "UPPERCASE", "WHITESPACE"
    };

    public static final int EOF=-1;
    public static final int ARROW=4;
    public static final int COLON=5;
    public static final int DIGIT=6;
    public static final int EPSILON=7;
    public static final int LOWERCASE=8;
    public static final int NEWLINE=9;
    public static final int NONTERMINAL=10;
    public static final int NUMBER=11;
    public static final int OR=12;
    public static final int PROBABILITY=13;
    public static final int TERMINAL=14;
    public static final int UPPERCASE=15;
    public static final int WHITESPACE=16;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public GrammarParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public GrammarParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return GrammarParser.tokenNames; }
    public String getGrammarFileName() { return "E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g"; }



    // $ANTLR start "productions"
    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:7:1: productions : ( left right NEWLINE )+ ;
    public final void productions() throws RecognitionException {
        try {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:7:16: ( ( left right NEWLINE )+ )
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:7:18: ( left right NEWLINE )+
            {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:7:18: ( left right NEWLINE )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==NONTERMINAL) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:7:19: left right NEWLINE
            	    {
            	    pushFollow(FOLLOW_left_in_productions19);
            	    left();

            	    state._fsp--;


            	    pushFollow(FOLLOW_right_in_productions21);
            	    right();

            	    state._fsp--;


            	    match(input,NEWLINE,FOLLOW_NEWLINE_in_productions23); 

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);


            }

        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "productions"



    // $ANTLR start "left"
    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:8:1: left : NONTERMINAL WHITESPACE ARROW ;
    public final void left() throws RecognitionException {
        try {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:8:16: ( NONTERMINAL WHITESPACE ARROW )
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:8:18: NONTERMINAL WHITESPACE ARROW
            {
            match(input,NONTERMINAL,FOLLOW_NONTERMINAL_in_left43); 

            match(input,WHITESPACE,FOLLOW_WHITESPACE_in_left45); 

            match(input,ARROW,FOLLOW_ARROW_in_left47); 

            }

        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "left"



    // $ANTLR start "right"
    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:1: right : ( WHITESPACE symbols )+ ( WHITESPACE OR ( WHITESPACE symbols )+ )* probabilities ;
    public final void right() throws RecognitionException {
        try {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:16: ( ( WHITESPACE symbols )+ ( WHITESPACE OR ( WHITESPACE symbols )+ )* probabilities )
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:18: ( WHITESPACE symbols )+ ( WHITESPACE OR ( WHITESPACE symbols )+ )* probabilities
            {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:18: ( WHITESPACE symbols )+
            int cnt2=0;
            loop2:
            do {
                int alt2=2;
                int LA2_0 = input.LA(1);

                if ( (LA2_0==WHITESPACE) ) {
                    int LA2_1 = input.LA(2);

                    if ( (LA2_1==EPSILON||LA2_1==NONTERMINAL||LA2_1==TERMINAL) ) {
                        alt2=1;
                    }


                }


                switch (alt2) {
            	case 1 :
            	    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:19: WHITESPACE symbols
            	    {
            	    match(input,WHITESPACE,FOLLOW_WHITESPACE_in_right65); 

            	    pushFollow(FOLLOW_symbols_in_right67);
            	    symbols();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    if ( cnt2 >= 1 ) break loop2;
                        EarlyExitException eee =
                            new EarlyExitException(2, input);
                        throw eee;
                }
                cnt2++;
            } while (true);


            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:40: ( WHITESPACE OR ( WHITESPACE symbols )+ )*
            loop4:
            do {
                int alt4=2;
                int LA4_0 = input.LA(1);

                if ( (LA4_0==WHITESPACE) ) {
                    int LA4_1 = input.LA(2);

                    if ( (LA4_1==OR) ) {
                        alt4=1;
                    }


                }


                switch (alt4) {
            	case 1 :
            	    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:41: WHITESPACE OR ( WHITESPACE symbols )+
            	    {
            	    match(input,WHITESPACE,FOLLOW_WHITESPACE_in_right72); 

            	    match(input,OR,FOLLOW_OR_in_right74); 

            	    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:55: ( WHITESPACE symbols )+
            	    int cnt3=0;
            	    loop3:
            	    do {
            	        int alt3=2;
            	        int LA3_0 = input.LA(1);

            	        if ( (LA3_0==WHITESPACE) ) {
            	            int LA3_1 = input.LA(2);

            	            if ( (LA3_1==EPSILON||LA3_1==NONTERMINAL||LA3_1==TERMINAL) ) {
            	                alt3=1;
            	            }


            	        }


            	        switch (alt3) {
            	    	case 1 :
            	    	    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:9:56: WHITESPACE symbols
            	    	    {
            	    	    match(input,WHITESPACE,FOLLOW_WHITESPACE_in_right77); 

            	    	    pushFollow(FOLLOW_symbols_in_right79);
            	    	    symbols();

            	    	    state._fsp--;


            	    	    }
            	    	    break;

            	    	default :
            	    	    if ( cnt3 >= 1 ) break loop3;
            	                EarlyExitException eee =
            	                    new EarlyExitException(3, input);
            	                throw eee;
            	        }
            	        cnt3++;
            	    } while (true);


            	    }
            	    break;

            	default :
            	    break loop4;
                }
            } while (true);


            pushFollow(FOLLOW_probabilities_in_right85);
            probabilities();

            state._fsp--;


            }

        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "right"



    // $ANTLR start "probabilities"
    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:10:1: probabilities : WHITESPACE COLON WHITESPACE PROBABILITY ;
    public final void probabilities() throws RecognitionException {
        try {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:10:16: ( WHITESPACE COLON WHITESPACE PROBABILITY )
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:10:18: WHITESPACE COLON WHITESPACE PROBABILITY
            {
            match(input,WHITESPACE,FOLLOW_WHITESPACE_in_probabilities94); 

            match(input,COLON,FOLLOW_COLON_in_probabilities96); 

            match(input,WHITESPACE,FOLLOW_WHITESPACE_in_probabilities99); 

            match(input,PROBABILITY,FOLLOW_PROBABILITY_in_probabilities101); 

            }

        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "probabilities"



    // $ANTLR start "symbols"
    // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:11:1: symbols : ( TERMINAL | NONTERMINAL | EPSILON );
    public final void symbols() throws RecognitionException {
        try {
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:11:16: ( TERMINAL | NONTERMINAL | EPSILON )
            // E:\\Dropbox\\TK2 PROJEKT NIE MA LIPY\\workspace-TK\\Grammar-parser\\src\\pl\\edu\\agh\\student\\janikhankus\\grammar\\Grammar.g:
            {
            if ( input.LA(1)==EPSILON||input.LA(1)==NONTERMINAL||input.LA(1)==TERMINAL ) {
                input.consume();
                state.errorRecovery=false;
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "symbols"

    // Delegated rules


 

    public static final BitSet FOLLOW_left_in_productions19 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_right_in_productions21 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_NEWLINE_in_productions23 = new BitSet(new long[]{0x0000000000000402L});
    public static final BitSet FOLLOW_NONTERMINAL_in_left43 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_WHITESPACE_in_left45 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ARROW_in_left47 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WHITESPACE_in_right65 = new BitSet(new long[]{0x0000000000004480L});
    public static final BitSet FOLLOW_symbols_in_right67 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_WHITESPACE_in_right72 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_OR_in_right74 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_WHITESPACE_in_right77 = new BitSet(new long[]{0x0000000000004480L});
    public static final BitSet FOLLOW_symbols_in_right79 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_probabilities_in_right85 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_WHITESPACE_in_probabilities94 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_COLON_in_probabilities96 = new BitSet(new long[]{0x0000000000010000L});
    public static final BitSet FOLLOW_WHITESPACE_in_probabilities99 = new BitSet(new long[]{0x0000000000002000L});
    public static final BitSet FOLLOW_PROBABILITY_in_probabilities101 = new BitSet(new long[]{0x0000000000000002L});

}